//
//  NetworkTools+Status.swift
//  LEOweibo
//
//  Created by zz on 16/3/6.
//  Copyright © 2016年 zz. All rights reserved.
//

import Foundation

extension NetworkTools {
    
    func loadStatus(since_id since_id:Int64 = 0,max_id:Int64 = 0, finished:(result:[String: AnyObject]?)->()) {
        
        guard let accessToken = UserAccount.sharedUserAccount.access_token else{
            return
        }
        let urlString = "https://api.weibo.com/2/statuses/friends_timeline.json"
        var params:[String:AnyObject] = ["access_token":accessToken]
        if since_id > 0{
            params["since_id"] = NSNumber(longLong:since_id)
        }
        if max_id > 0{
            params["max_id"] = NSNumber(longLong:max_id)
        }
        request(.GET, urlString: urlString, parameter: params, finished: finished)
    }
}